package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author 2230823078_淡嘉浩
 * @Date 2025/3/8 上午9:10
 * Please don't copy!
 */
@Mapper
public interface SetmealDishMapper {

    List<Long> getSetmealIdsByDishIds(Long[] dishIds);

    @Insert("insert into setmeal_dish (setmeal_id, dish_id, name, price,copies)" +
            "value(#{setmealId} ,#{dishId} ,#{name} ,#{price} ,#{copies})")
    void inset(SetmealDish setmealDish);

    void insetBatch(List<SetmealDish> setmealDishes);

    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);

}
